package com.pxml2pdf.pxml;


import java.util.ArrayList;
import java.util.List;

public class Pxml {
	private String format;
	private String id;
	private Float left;
	private Float top;
	private Float width;
	private Float height=-1f;
	private List<Ppage> ppageList;

	public String getFormat() {
		return format;
	}

	public void setFormat(String format) {
		this.format = format;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Float getLeft() {
		return left;
	}

	public void setLeft(Float left) {
		this.left = left;
	}

	public Float getTop() {
		return top;
	}

	public void setTop(Float top) {
		this.top = top;
	}

	public Float getWidth() {
		return width;
	}

	public void setWidth(Float width) {
		this.width = width;
	}

	public Float getHeight() {
		if (height==-1f){
			height = 0f;
			for(Ppage pp :ppageList){
				height+= pp.getHeight();
			}
		}
		return height;
	}

	public List<Ppage> getPpageList() {
		if (ppageList==null){
			ppageList = new ArrayList<Ppage>();
		}
		return ppageList;
	}

	public void setPpageList(List<Ppage> ppageList) {
		this.ppageList = ppageList;
	}



}
